﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;

namespace MyBlog2.Models
{
    public class Tag
    {
        public Tag()
        {
            ArticleTag = new HashSet<ArticleTag>();
        }

        [Key]
        public int Id { get; set; }

        [Required(ErrorMessage = "{0}不能为空")]
        [Display(Name = "标签名称")]
        public string Name { get; set; }

        public virtual ICollection<ArticleTag> ArticleTag { get; set; }      //关联
    }
}
